Conversation
Rsdoctor Bundle Diff AnalysisFound 2 projects in monorepo, 2 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 rsbuild-demoPath:
📁 rsbuild-demo2Path:
Generated by Rsdoctor GitHub Action |
There was a problem hiding this comment.
Pull request overview
Adds AI-powered degradation analysis to the Rsdoctor GitHub Action by generating bundle-diff JSON and sending it to an LLM (Anthropic/OpenAI), then appending the results to the PR comment.
Changes:
- Added
ai_modelaction input and plumbed AI token/model through the processing pipeline. - Implemented
src/ai-analysis.tsto build prompts, detect provider, and call Anthropic/OpenAI APIs. - Enhanced PR comment output with an expandable “AI Degradation Analysis” section per project.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/index.ts | Runs JSON bundle-diff generation, calls AI analysis, and appends AI results into PR comments. |
| src/ai-analysis.ts | New module to detect provider, build prompts, call LLM APIs, and return markdown analysis. |
| action.yml | Adds the new ai_model input for selecting the model. |
| dist/index.js | Compiled output updated to include AI analysis behavior. |
|
That's a very interesting feature 👀 Do you plan to also make it ❌ on the PR? e.g. if some condition / based on some rules aren't satisfied (e.g; bundle size regression) could it make Github PR Status go fail? |
@gre Before, I was afraid that it was not very stable at present, and I was afraid of misjudgment and interference, which would increase the threshold ability later. |
242fe14 to
2ed0bfb
Compare
ba92e17 to
1dc69ef
Compare
This pull request introduces an AI-powered degradation analysis feature to the Rsdoctor GitHub Action, enabling automated bundle size regression reports using Anthropic or OpenAI models. The main changes add a new input for selecting the AI model, implement logic to generate and analyze bundle diffs with AI, and update the PR comment to include the AI's findings.
AI analysis integration:
ai_modelinput toaction.ymlto allow users to specify which AI model to use for degradation analysis; the provider is auto-detected from the model name.src/ai-analysis.ts, which detects the provider, builds prompts, and calls Anthropic or OpenAI APIs to analyze bundle diff JSONs and return concise markdown reports.src/index.tsto:ProjectReporttype to include AI analysis results. [1] [2]aiTokenandaiModelthrough the processing pipeline and generate bundle diff JSONs for AI analysis per project, handling both direct and npx-based CLI invocation. [1] [2] [3] [4]PR comment/report enhancements: